package com.liang.common;

import cn.hutool.core.util.EnumUtil;
import cn.hutool.http.HttpStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.nio.file.AccessDeniedException;
import java.util.LinkedHashMap;


@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

	private final LinkedHashMap<String, CommonCode> enumMap = EnumUtil.getEnumMap(CommonCode.class);


	@ExceptionHandler(value = Exception.class)
	public Result illegalStateExceptionHandler(Exception e) {
		log.error(e.getMessage(),e);
		return Result.buildFail();
	}

}
